import Vue from "vue";
import VueRouter from "vue-router";
const Home = () => import('../views/Home')
const Player = () => import ("../views/Player");
const SongList = () => import ('../views/SongList');
// gaocaiyan
const PersonalRecommend = () => import ('../views/PersonalRecommend/recommend.vue');
const DuJiaSong = () => import ("../views/DuJiaSong/dujia.vue");
const NewMv = () => import ("../views/NewMv/mv.vue");
// yidaqing
const Login = () => import ("../views/Login");
const Register = () => import ("../views/Register");
const Personal = () => import ("../views/Personal");
const PersonalMessage = () => import ("../views/PersonalMessage");
const CodePage = () => import ("../views/CodePage");
// jichenyi
const Songsheet = () => import ("../views/Songsheet");
//wangxu
const UserFans = () => import ("../views/UserFans");
Vue.use(VueRouter);


const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
    redirect: {
      name: "PersonalRecommend"
    },
    children: [
      // 个人推荐
      {
        path: "/personalrecommend",
        name: 'PersonalRecommend',
        component: PersonalRecommend,
      },
      // 展示很多歌单的页面
      {
        path: "/songlist",
        name: 'SongList',
        component: SongList,
      },
      // 独家放送列表
      {
        path: "/dujiasong",
        name: 'DuJiaSong',
        component: DuJiaSong,
      },
      // 最新mv列表
      {
        path: "/newmv",
        name: 'NewMv',
        component: NewMv,
      },
      // 歌单展示
      {
        path: "/songsheet",
        name: 'Songsheet',
        component: Songsheet,
      },
      {
        path: "/userfans/:userId/:type",
        name: "UserFans",
        component: UserFans,
      },
      {
        path: "/personal/:id?",
        name: 'Personal',
        component: Personal
      },
      {
        //个人信息页面
        path: '/personalmessage',
        name: 'PersonalMessage',
        component: PersonalMessage
      },
      {
        // 登录路由
        path: '/login',
        name: 'Login',
        component: Login
      },
      {
        // 注册路由
        path: '/register',
        name: 'Register',
        component: Register
      },
      {
        //获取注册验证码页面
        path: '/codepage',
        name: 'CodePage',
        component: CodePage
      },


    ],
  },

  {
    path: "/player/:musicId?",
    name: "Player",
    component: Player,
  },


]



const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
